
/***************************************************************************
 *   confab 
 *                                                                         *
 *   Copyright (C) 2010 by kuerant                                         *
 *                         <kuerant@gmail.com>                             *
 *                                                                         *
 *   This library is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU Library General Public License as       *
 *   published by the Free Software Foundation; either version 2 of the    *
 *   License, or (at your option) any later version.                       *
 *                                                                         *
 *   This library is distributed in the hope that it will be usefull, but  *
 *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      *
 *   Library General Public License for more details.                      *
 *                                                                         *
 *   You should have received a copy of the GNU Library General Public     *
 *   License along with this library; if not, write to the Free Software   *
 *   Foundation, Inc., 59 Temple Place - Suite 330, Boston,                *
 *   MA 02111-1307, USA                                                    *
 ***************************************************************************/

#include <list>
#include <string>

#include <boost/thread/mutex.hpp>

#include <db_cxx.h>

#include "bocat/common/lrucache.hpp"

#include "store.hpp"
#include "aucab.hpp"


namespace	confab	{


struct	SleepyConfig
{
public	:
	std::string	envhome;		// path to environment home
	std::string	dbhome;	    	// path to db home
	std::string	datahome;		// path to data home

public	:
	SleepyConfig( const char* config_filename );

private :
	#define	INI_SECTION		"confab::store"

	int		parseConfig( const char* config_filename );
};	//// class SleepyConfig


///////////////////////////////////////////////////////////////////////
//  class SleepyStore
//

class	SleepyStore
		:	public Store
{

public  :
	SleepyStore( const char* config_filename );

    virtual ~SleepyStore(); 

public  :

    virtual int     insert( const std::string& kpin,
                            const std::string& key, 
                            const std::string& data );


    virtual int     find( const std::string& kpin,
                          const std::string& key, 
                               std::string& buf  );


    virtual int     erase( const std::string& kpin,
                           const std::string& key );


private	:

	SleepyConfig	_config;

    Aucab   _aucab;

};	//// class SleepyStore



}	//// namespace confab

